#
#
#

"""
	x.x.x 2002-Jul-15 added LineReaderN
"""

class LineReader:
	def __init__ (self, src):
		self.lines = src
		self.pos = 0
		self.name = '?'
	def __del__ (self):
		self.close ()
	def seek (self, n):
		self.pos = n
	def tell(self):
		return self.pos
	def readlines (self):
		rv = []
		r  = self.readline ()
		while r != None:
			rv.append (r)
			r  = self.readline ()
		return rv
	def _get_line (self, n):
		return self.lines[n]
	def readline (self):
		try:
			r = self._get_line (self.pos)
			self.pos = self.pos + 1
		except IndexError:
			r = None
			#~ print 3030
		#~ print 29, r
		return r
	def close (self):
		self.lines = None
		#~ del self.lines

class LineReaderN(LineReader):
	def _get_line (self, n):
		return self.lines[n]+'\n'

#
# eof
#
